<!DOCTYPE html>
<!--suppress ALL-->
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta charset="UTF-8">
    <!--<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>-->
    <script th:src="@{/js/jquery-1.11.3.min.js}"></script>
    <link th:href="@{/bootstrap/bootstrap.min.css}" rel="stylesheet">
    <title>系统设置</title>
</head>
<style type="text/css">
    .modal {
        position: fixed;
        z-index: 99999;
        background-color: rgb(0, 0, 0, 0.5);
        border: 2px ;
        border-radius: 26px;
        width: 180px;
        height: 50px;
        font-size: 14px;
        color: white;
        text-align: center;
        display: none;
        line-height: 50px;
        left: 40%;
        top: 1%;
    }
</style>
<body>
<div class="row" style="text-align: center;margin-top: 2%;margin-left: 10%;margin-right: 10%">
    <table class="table table-hover">
        <caption style="text-align: center;font-size: 16px"><span th:text="${glo[0].gsetvalue}"></span></caption>
        <tbody>
        <b th:each="list:${glo}">
            <tr>
                <td style="text-align: right;width: 700px" th:text="${list.gsetdesc}+':'"></td>
                <b th:if="${list.gsetvalue} eq '1' or ${list.gsetvalue} eq '0'">
                    <td style="text-align: left;width: 800px">
                        <div class="row">
                            <div class="col-sm-2">
                                <input th:onclick="|javascript:changeRadio('0','${list.gsetname}')|" th:name="${listStat.index}" th:checked="${list.gsetvalue} eq '0'" style="-webkit-border-radius:50%;" type="radio" />&nbsp;<label>0</label>
                                <input th:onclick="|javascript:changeRadio('1','${list.gsetname}')|" th:name="${listStat.index}" th:checked="${list.gsetvalue} eq '1'" style="-webkit-border-radius:50%;" type="radio" />&nbsp;<label>1</label>
                            </div>
                        </div>
                    </td>
                </b>
                <b th:unless="${list.gsetvalue} eq '1' or ${list.gsetvalue} eq '0'">
                    <td style="text-align: left;width: 800px"><input th:id="${list.gsetname}" onchange="changeRadio(this.value,this.id)" th:value="${list.gsetvalue}"/></td>
                </b>
            </tr>
        </b>
        </tbody>
    </table>
    <div class="modal"></div>
</div>
<script>
    function showMessage(data) {
        $('.modal').html(data);
        $('.modal').fadeIn();
        setTimeout(function () {
            $('.modal').fadeOut();
        }, 1000);
    };
    function changeRadio(value,name) {
        $.ajax({
            url: "/admin/admin/sysPost",
            datatype: "json",
            type: "POST",
            data: {
                value: value,
                name: name
            },
            success: function () {
                showMessage("修改成功")
            }
        })
    }
</script>
</body>
</html>
